<{include file="admin:common/header.html"}>
<div class="page-title">
    <table width="100%" align="center" cellpadding="0" cellspacing="0" >
      <tr>
        <td width="30" align="right"><img src="<{$pager.url}>/images/main-h5-ico.gif" alt="" /></td>
        <th><{$MOD.title}></th>
        <td align="right"><{link ctl="company/youhui:index" priv="hidden" class="button"}></td>
        <td width="15"></td>
      </tr>
    </table>
</div>
<div class="page-data">
<form action="?company/youhui-edit.html" mini-form="youhui-form" method="post" ENCTYPE="multipart/form-data">
<table width="100%" border="0" cellspacing="0" class="table-data form">
<tr><th><span class="red">*</span>优惠标题：</th><td><input type="text" name="data[title]" value="<{$detail.title|default:''}>" class="input w-300"/></td></tr>
<tr><th class="w-100">城市：</th>
    <td>
        <b class="blue"><{$detail.city_name}></b>
        <select name="data[area_id]" class="w-150"><{widget id="data/area" city_id=$detail.city_id value=$detail.area_id}></select>
    </td>
</tr>
<input type="hidden" name="youhui_id" value="<{$detail.youhui_id}>"/>
<tr><th><span class="red">*</span>公司：</th>
    <td>
    	<b class="blue"><{$company.name}></b>
    </td>
</tr>
<tr><th><span class="red">*</span>日期：</th>
    <td>
        <input type="text" name="data[stime]" value="<{$detail.stime|format:'Y-m-d'}>" class="input w-100" date="bg_date" readonly/>~
        <input type="text" name="data[ltime]" value="<{$detail.ltime|format:'Y-m-d'}>" class="input w-100" date="end_date" readonly/>
    </td>
</tr>
<tr><th><span class="red">*</span>缩略图：</th>
    <td>
        <input type="file" name="data[photo]" class="input w-300" style="vertical-align:middle;display:inline;"/>
        <{if $detail.photo}><img src="<{$pager.img}>/<{$detail.photo}>" photo="<{$pager.img}>/<{$detail.photo}>" class="wh-30" style="vertical-align:middle;display:inline;"/><{/if}>
    </td>
</tr>
<tr><th><span class="red">*</span>优惠说明：</th><td><textarea name="data[content]" kindeditor="full" style="width:800px;height:350px;"><{$detail.content}></textarea><br /></td></tr>
<tr><th>审核：</th><td>
	<label><input type="radio" name="data[audit]" <{if $detail.audit}>checked="checked"<{/if}> value="1"/>是</label>&nbsp;&nbsp;
	<label><input type="radio" name="data[audit]" <{if empty($detail.audit)}>checked="checked"<{/if}> value="0"/>否</label></td></tr>
<tr><th>报名数：</th><td><input type="text" name="data[sign_num]" value="<{$detail.sign_num|default:''}>" class="input w-300"/></td></tr>
<tr><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据" /></td></tr>
</table>
</form></div>
<script type="text/javascript" src="<{$pager.res}>/kindeditor/kindeditor.js"></script>
<script type="text/javascript">
(function(K, $){
var editor = KindEditor.create('textarea[kindeditor]', {uploadJson : '?magic/upload-editor.html', extraFileUploadParams:{OATOKEN:"<{$OATOKEN}>"}});
})(window.KT, window.jQuery);
</script> 
<script type="text/javascript">
(function(K, $){
$("select[name='data[city_id]']").live('change', function(){
	var city_id = $(this).val();
	if(!city_id){return false;}
	$.getJSON("?data/area-city-"+city_id+".html", function(ret){
		if(ret.error){
			Widget.MsgBox.error(ret.message.join(","));
		}else if(ret.areas.length>0){
			var html = "";
			for(var i=0; i<ret.areas.length; i++){
				html += '<option value="'+ret.areas[i].area_id+'">'+ret.areas[i].area_name+'</option>';
			}
			$("select[name='data[area_id]']").html(html);		
		}else{
			$("select[name='data[area_id]']").html('<option value="">--</option>');
		}
	});
});
})(window.KT, window.jQuery);
</script>
<{include file="admin:common/footer.html"}>